<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld/" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld/" prefix="html"%>

<script>
  window.onload = function() {
                document.getElementById('radioButtonFormatoXml').checked = true;
                         }
</script>

<div class="centerContent">

<h1><bean:message key="pmt.importarPlan.importarPlanificacion" /></h1>
<html:form action="/importarPlanificacionDispatch" styleId="importarPlanFormId" onsubmit="return validateImportarPlanForm(this);" method="post" enctype="multipart/form-data" >
  <table align="left">

    <tr>
      <td class="right"><bean:message
        key="pmt.importarPlan.proyectos" /></td>
      <td class="left"><html:select property="proyectoSel" styleId="cmbProyecto" >
              		<html:option value=""><bean:message key="pmt.combos.primerValor"/></html:option>
                   <html:optionsCollection property="proyectos" label="nombre" value="id" />
          	</html:select>&nbsp;&nbsp;<html:link href="crearProyectoInicial.do">
        <bean:message key="pmt.importarPlan.proyectoNuevo" />
      </html:link></td>
      <td></td>
    </tr>
    <tr>
      <td class="right"><bean:message
        key="pmt.importarPlan.peticion" /></td>
      <td class="left"><html:text styleClass="texto" styleId="nombrePeticionId" property="peticionSel" /></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td class="left"><html:radio property="formatoXml" value="xls" />
			<bean:message key="pmt.importarPlan.formatoExcel(xls)" />&nbsp;&nbsp;
			<html:link href="formatoValidoMicrosoftProject.do" onclick="window.open(this.href); return false" >
				<bean:message key="pmt.importarPlan.formatoValido" />
			</html:link></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td class="left"><html:radio property="formatoXml"
        value="xml" styleId='radioButtonFormatoXml' /><bean:message
        key="pmt.importarPlan.formatoPojectMicrosoft(xml)" />&nbsp;&nbsp;
        <html:link href="formatoValidoMicrosoftProject.do" onclick="window.open(this.href); return false" >
				<bean:message key="pmt.importarPlan.formatoValido" />
		</html:link>
      </td>
      <td></td>
    </tr>
    <tr>
      <td class="right"><bean:message
        key="pmt.importarPlan.fichero" /></td>
       <td class="textAlignLeft">
      	<html:file styleClass="texto" titleKey="pmt.importarPlan.examinar" styleId="archivoId"  property="theFile" />
       </td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
      	<td class="left">
      		<html:button property="method" onclick="lanzarImportacion(validateImportarPlanForm(document.getElementById('importarPlanFormId'))); " ><bean:message key="pmt.boton.importar" />  </html:button>
      		
	 	</td>
    </tr>
  </table>
  <br>
  <html:javascript formName="importarPlanForm" />
    

<script>
function lanzarImportacion(ejecutar) {

	if(ejecutar){
		importacionFunc();
		llamadorImportando();	
	}

}
</script>  

  
</html:form>
</div>


 